#ifndef _PHY_ENGINE_H_
#define _PHY_ENGINE_H_

#include "RigidBody.h"
#include <vector>

using namespace std;

typedef vector<Vec2d> CollisionPointList;

class PhyEngine
{
public:
	PhyEngine(void);
	~PhyEngine(void);
	PhyEngine(RigidBodyList* bodies, bool edge_intersection);

	void processCollisions(double dt);

	CollisionPointList* checkCollision(RigidBody* b0, RigidBody* b1);

	void resolveCollision(RigidBody* b0, RigidBody* b1, CollisionPointList* cps);

	void generateForce(Vec2d p, Vec2d n, double d, double r, RigidBody* b0, RigidBody* b1);

	void generateGravity();

	void update(double dt);

	RigidBodyList* bodies;

	bool edge_intersection;
};

#endif


